<?php
class Slideimages_model extends Model{
	function Slideimages_model()
	{
		parent::Model();
	}
	function show($type)
	{
		if($type=='main')
		{
		  $this->db->limit(4);
		}
		else if($type=='sub')
		{
		  $this->db->limit(12);
		 
		}
		 $this->db->order_by('id','desc');
		$this->db->where_in('type',$type);
		$query = $this->db->get('slideimages');
		$res = $query->result();
		//print_r($res);
		return $query;
	}
	function add()
	{
//	
    }
    function delete($id)
    {
    	$this->db->where('id',$id);
    	$this->db->delete('slideimages');
    }
}

?>